/*
*******************************************************************************
* ansi c source code
* file name:
*	InsertPilot.c
* abstract:
*	complete the bit reverse of the input
* author:Fangming He
*******************************************************************************
*/

/*
*******************************************************************************
*                               include files
*******************************************************************************
*/
#include "globaldef.h"
#include "globalVai.h"

/*
*******************************************************************************
*                            function definition
*******************************************************************************
*/
/*
******************************************************************************* 
* description:
*	to insert pilot on the speclized position 
*   the pilot is a un-modulated data (1or-1)
* input:
*	PilotSpace  : the space between two adjacment pilot
*	Pilot_PN :    the pilot data needed being inserted
*   Symbol :      the OFDM Symbol needed being inserted pilot
*  output :
*   Symbol :      
* author:
*	cao yanyan       2006-05-31
* revision history:
*	cao yanyan       2006-05-31 original version
*******************************************************************************
*/



void InsertPilot(int PilotSpace, int *Pilot_PN, struct Complex *Symbol)
{
	/*calculate the number of pilots to insert in the symbol*/
	int pilot_num;
	int i;

	pilot_num=FFT_Size/Pilot_Space;
    
	for(i=0;i<pilot_num;i++)
	{
		/*insert the pilot PN sequence uniformly */
		Symbol[96+i*PilotSpace].real = Pilot_PN[i];
	}

	/*Make sure that the last tone occupied by the pilot*/
	Symbol[FFT_Size+CP_Length-1].real = Pilot_PN[pilot_num];

}
